import requset from "../../utils/requset";

export default {
  //获取粉丝数量  当前页数offset   每页显示条数limit
  getUserFans: (uid, limit, offset, type) => {
    const url = type == 1 ? `/user/follows` : `/user/followeds`;

    return requset.get(
      `${url}?uid=${uid}&limit=${limit}&offset=${offset}&timestamp=${new Date().getTime()}`
    );
  },

  //  获取用户姓名
  getUserInfo: (uid) => {
    return requset.get(`/user/detail?uid=${uid}`);
  },

  //关注用户
  getUserFollow: (id, t) => {
    return requset.get(
      `/follow?id=${id}&t=${t}&timestamp=${new Date().getTime()}&cookie=${localStorage.getItem(
        "cookie"
      )} `
    );
  },

  //取消关注
  getUserFollowed: (id, t) => {
    return requset.get(
      `/follow?id=${id}&t=${t}&cookie=${localStorage.getItem("cookie")} `
    );
  },
};
